package com.zjut.zs.shhd.manager;

import java.util.List;

import javax.annotation.Resource;

import com.zjut.an.util.module.PageModule;
import com.zjut.zs.shhd.dao.ZsShhd;
import com.zjut.zs.shhd.dao.ZsShhdDAO;
import com.zjut.zs.user.dao.ZsUser;
import com.zjut.zs.zxlb.dao.ZsZxlb;


public class ZsShhdManager {

	@Resource(name = "ZsShhdDAO")
	private ZsShhdDAO dao;
	
	public void addData(ZsShhd obj) {	
		dao.save(obj);
	}
	
	public void updateData(ZsShhd obj) {
		dao.update(obj);
	}
	
	public void deleteData(ZsShhd obj) {
		dao.delete(obj);
	}

	public void deleteDatas(List<ZsShhd> objlist) {
		for (ZsShhd ZsShhd : objlist) {
			dao.delete(ZsShhd);
		}
	}
	
	public PageModule getDataByInstance (int pageNumber,int pageSize, String sort, String order, ZsShhd obj) {
		return dao.findByInstance(pageNumber, pageSize, sort, order, obj);
	}
	
	public List getDatas() {
		return dao.findAll();
	}

	public ZsShhd getData(String objId) {
		return dao.findById(objId);
	}

	public List getDataByUser(ZsUser user) {
		ZsShhd obj = new ZsShhd();
		obj.setZsUser(user);
		return this.getDataByInstance(1, 1000, null, null, obj).getObjects();
	}
}
